<%-- 
    Document   : addCategory
    Created on : Jun 5, 2012, 2:20:34 PM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>
<html>
    <head>
        <title>Add Category</title>
    </head>
    <body>
        <div class="clear"></div>
        <table cellspacing="5px" width="100%" align="center">
            <tr>
                <td>
                    <table cellspacing="5px" width="100%" align="center">
                        <tr>
                            <td style="vertical-align: top;" width="20%">
                                <%@include file="/jsp/right.jsp" %>
                            </td>
                            <td>                &nbsp;            </td>
                            <td style="vertical-align: top;" width="80%">
                                <div class="page-title"><h1>Manage Categories</h1></div>
                                <table border="1" cellspacing="10px" align="center">
                                    <tr>
                                        <td><h2>Add Category</h2></td>
                                        <td><a href="./category.do?action=showManageCategory">List Categories</a></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <html:form action="/category" method="post" enctype="multipart/form-data">
                                                <table border="1" cellspacing="10px" align="center">
                                                    <tr>
                                                        <td colspan="2">Category Details</td>
                                                    </tr>
                                                    <tr>
                                                        <td>Category Name:</td>
                                                        <td><html:text property="categoryName"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errCategoryName"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Category Title:</td>
                                                        <td><html:text property="categoryTitle"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errCategoryTitle"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            Select Whether Main Category Or Select its Parent Category
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div id="maincategory" style="display: block">
                                                                <html:checkbox  property="mainCategory" onchange="javascript:togglediv('parentCategory');" value="ON"/> Main Category
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div id="parentCategory" style="display: block">
                                                                Parent Category:<br/><html:select property="parentCategoryId" onchange="javascript:togglediv('maincategory');">
                                                                    <html:option value="0">--Select--</html:option>
                                                                    <html:options collection="parentCategList" property="key" labelProperty="value"/>
                                                                </html:select>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errParentCategory"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Image:</td>
                                                        <td><html:file property="categoryImage" accept="image/*" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errCategoryImage"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Status:</td>
                                                        <td><html:select property="categoryStatusId">
                                                                <html:option value="0">--Status--</html:option>
                                                                <html:options collection="statusList" property="key" labelProperty="value"/>
                                                            </html:select>  </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errCategoryTitle"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Short Description:</td>
                                                        <td><html:textarea property="categoryDesc"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><html:errors property="errCategoryDescription"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <div id="errdividcategory" >
                                                                <span id="errspanidcategory"></span>
                                                                <html:errors property="errCategory"/>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2"><a onclick="javascript:return validateCategory('./category.do?action=saveCategory','CategoryBean')">
                                                                <img src="images/save.png" onmouseout="src='images/save.png'" onmouseover="src='images/save-hover.png'" alt="Save Category" /></a></td>
                                                    </tr>
                                                </table>
                                            </html:form>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td><%@include file="/jsp/footer.jsp" %></td>
            </tr>
        </table>



    </body>
</html>
